home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 8
/
QRZ Ham Radio Callsign Database - Volume 8.iso
/
pc
/
files
/
dsp
/
a56_10sh.z
/
a56_10sh
/
examples
/
test-dac.a56
< prev
next >
Wrap
Text File
|
1996-06-25
|
2KB
|
141 lines
; Various tests for output filter and DAC. I used a Nippon Precision Circuits
; SM5813AP dual-channel 8-times oversampling digital filter into a Burr Brown
; PCM1700P dual-channel 18-bit DAC. The code is very specific to my hardware.
;
; available signals:
; impulse
; square
; triangle
; sine (uses twin-integrator harmonic oscillator)
;
; This code is not interrupt driven but simple spins waiting for transmitter
; ready on each sample.
;
;
; written by Quinn Jensen
; work: jensenq@npd.novell.com
; home: jensenq@qcj.icon.com
;
include 'ioequ.inc'
org p:$0000
jmp <start
org p:$000C
;ssi jsr ssi_int ;go handle SSI interrupt
; data areas
org x:$0
i_left dc 0 ;left channel in
i_right dc 0 ;right channel in
org p:$40
start
; assign mode
movec #$0300,sr ;go to IPL 3
; set up interrupts
; movep #0<<13|3<<12|0<<10,x:m_ipr ;put SSI at lev 3, others off
; set system sample rate
bclr #6,x:<<m_pbd ;32.55 kHz
bset #5,x:<<m_pbd ;
bclr #4,x:<<m_pbd ;
; set up SSI
movep #2<<13|1<<8,x:m_cra ;16-bit word, 2 time slots
movep #0<<15|3<<12|1<<11|1<<9,x:m_crb ;sync,network,enable
movep #0,x:m_pcddr ;port C is SSI/SCI
movep #$1FF,x:m_pcc ;port C is SSI/SCI
; enable interrupts
; movec #0,sr ;lower IPL
jmp <impulse ;jump to the desired signal
; impulse
impulse
move #>-.5,a
im1
do #400,im0
jsr <imp
im0
neg a
jsr <imp
neg a
jmp <im1
imp
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
rts
; square wave
square
move #>-.1,a
sq1
do #200,sq0
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
sq0
neg a
jmp <sq1
; triangle wave
triangle
move #>.010,x0
move #>-.9,a
l0
do #90*2,l1
add x0,a
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
l1
move x0,b
neg b
move b,x0
jmp <l0
; sine wave
sine
move #>.050,x0 ;oscillator freq
move #>-.209,a ;initial conditions
move #>.2090,b ;
loop
mac x0,y0,a
move a,y0
jclr #6,x:m_sr,* ;wait for transmitter ready
movep a,x:m_tx
mac -x0,y0,b
move b,y0
jclr #6,x:m_sr,* ;wait for transmitter ready
movep b,x:m_tx
jmp <loop
end